/*
 *  Copyright 2008-2010 the original author or authors.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package org.openaecfm.spf.model;

import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * The file schema entity.
 * @author Qiu Kuining
 */
public class FileSchema {

    private List<String> schema_identifiers = new ArrayList<String>();

    /**
     * Get the schema identifiers.
     * @return
     */
    public List<String> getSchema_identifiers() {
        return schema_identifiers;
    }

    /**
     * Set the schema identifiers.
     * @param schema_identifiers
     */
    public void setSchema_identifiers(List<String> schema_identifiers) {
        this.schema_identifiers = schema_identifiers;
    }

    /**
     * Add a schema identify.
     * @param s
     */
    public void addSchema_identify(String s) {
        if (schema_identifiers == null) {
            schema_identifiers = new ArrayList<String>();
        }
        schema_identifiers.add(s);
    }

    public String getSchemaName() {
        String name = "";
        Iterator<String> i = schema_identifiers.iterator();
        if (i.hasNext()) {
            name = i.next();
        }
        while (i.hasNext()) {
            name = name + "-" + i.next();
        }
        
        return name;
    }
}
